package ar.com.spsolutions.splilabrary.view.components.modalwindow;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;

public class SelectModalWindow extends ModalWindow {
	private static final long serialVersionUID = 8722959603451030448L;

	public SelectModalWindow(final String id) {
		super(id);

		// Set sizes of this ModalWindow. You can also do this from the HomePage
		// but its not a bad idea to set some good default values.
		this.setInitialWidth(100);
		this.setInitialHeight(50);

		this.setTitle("Info");

		// Set the content panel, implementing the abstract methods
		this.setContent(new SelectContentPanel(this.getContentId()) {
			private static final long serialVersionUID = 4891639920530409210L;

			@Override
			public void onCancel(final AjaxRequestTarget target) {
				SelectModalWindow.this.close(target);
			}

			@Override
			public void onSelect(final AjaxRequestTarget target,
					final String selection) {
				SelectModalWindow.this.close(target);
			}
		});
	}

	// abstract void onCancel(AjaxRequestTarget target);
	//
	// abstract void onSelect(AjaxRequestTarget target, String selection);

}
